package com.ywu.application.standard.demandManagement.api;

import com.ywu.common.result.CommonResult;
import com.ywu.application.standard.demandManagement.dto.YwuDemandManageDto;
import com.ywu.application.standard.demandManagement.service.YwuDemandManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName YwuDemandManageApi
 * @Description TODO
 * @Author GroundDemo
 * @Date 2025/3/31 15:31
 * @Version 1.0
 **/
@RestController
@RequestMapping("/ywu/demand/manage")
public class YwuDemandManageApi {
    @Autowired
    private YwuDemandManageService service;

    /**
    * @Author GroundDemo
    * @Description 查询需求列表
    * @Date 15:42 2025/3/31
    * @Param []
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/demand.list.info")
    public CommonResult<Object> queryDemandList(@RequestBody YwuDemandManageDto dto) {
        return service.queryDemandList(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 添加需求
    * @Date 15:53 2025/3/31
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/demand.create.info")
    public CommonResult<Object> createDemand(@RequestBody YwuDemandManageDto dto) {
        return service.createDemand(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 修改需求
    * @Date 16:27 2025/3/31
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/demand.update.info")
    public CommonResult<Object> updateDemand(@RequestBody YwuDemandManageDto dto) {
        return service.updateDemand(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 删除需求
    * @Date 16:38 2025/3/31
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/demand.delete.info")
    public CommonResult<Object> deleteDemand(@RequestBody YwuDemandManageDto dto) {
        return service.deleteDemand(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 查询列表数据局，不生成层级关系
    * @Date 22:39 2025/3/31
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/demand.query.list.info")
    public CommonResult<Object> queryList(@RequestBody YwuDemandManageDto dto) {
        return service.queryList(dto);
    }
}
